/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Utils;

import Utils.currency.CursLocator;
import Utils.currency.IDMoneda;
import java.util.Calendar;

public class CursInfoValutar {

    public static double GetValue(String moneda) {
        try {
            Calendar cDate = Calendar.getInstance();

            CursLocator cursLocator = new CursLocator();
            double curs = 0;

            curs = cursLocator.getCursSoap().getLatestValue(IDMoneda.fromString(moneda));

            if (curs != -1) {
                return curs;
            } else {
                return -1;
            }
        } catch (Exception e) {
            return -1;
        }
    }
}
